*** REPLICATION FILE -- Analysis
*** Lawrence Ezrow, Margit Tavits & Jonathan Homola
*** "Voter Polarization, Strength of Partisanship, 
*** and Support for Extremist Parties"
*** Comparative Political Studies 47: 1558-1583
*** http://dx.doi.org/10.1177/0010414013512605

** read in the main dataset (specify full file path)
use ...EzrowTavitsHomola_PolarizationExtremism_Data.dta

** install grinter if not already installed
*net from http://myweb.uiowa.edu/fboehmke/stata/grinter

** Figure 2
reg avs dist mv_stddev distxmv_std nop5, cluster(electid)
grinter dist , const02(mv_stddev) inter(distxmv_std) yline(0) nomean

** Figure 3a
reg avs dist distxmv_std mv_stddev nop5 if postcom==1, cluster(electid)
grinter dist , const02(mv_stddev) inter(distxmv_std) yline(0) nomean

** Figure 3b
reg avs dist distxmv_std mv_stddev nop5 if advind==1, cluster(electid)
grinter dist , const02(mv_stddev) inter(distxmv_std) yline(0) nomean